package com.chengfei.thread.demo1;

import java.util.Timer;
import java.util.TimerTask;

/**
 * 定时器
 *
 * @author chengfei5
 * @date 2019/1/7
 */
public class NewThread5 {

    public static void main(String[] args) {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("任务正在执行");
            }
        }, 0, 1000);
    }
}
